package writers;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class XMLWriter
{
	protected String fileName = "";
	protected PrintWriter out;
	
	protected void openFile()
	{
		try
		{
			out = new PrintWriter(new FileWriter(fileName), true);
		}
		catch (IOException e)
		{
			out = null;
			e.printStackTrace();
		}
	}
	
	protected void closeFile()
	{
		if(out!=null)
			out.close();
	}
	
	protected void writeToFile(String str)
	{
		out.println(str);
	}
	
	public void write(Object date)
	{
		// you should override this method.
	}
	
	public String getFileName()
	{
		return fileName;
	}

	public void setFileName(String fileName)
	{
		this.fileName = fileName;
	}

}
